package com.dns.customers.dao;

import com.dns.framework.data.IDataset;
import com.dns.framework.page.Pagination;


import java.util.List;
import java.util.Map;

public interface DomainDao  {

    /**
     * 修改根域名
     * @param custId 客户id
     * @param rootDomains 域名集合
     * @return
     * @throws Exception
     */
    public String custDomain(String custId,List<Map<String,Object>> rootDomains) throws Exception;

    /**
     * 新增或修改子域名
     * @param custId
     * @param childDomainMap
     * @return
     * @throws Exception
     */
    public String custChildDomain(String custId,Map<String,List<Map<String,Object>>> childDomainMap) throws Exception;
    /**
     * 根据域名名称和等级查询域名的所有类型
     * @return
     */
    public List<String> checkDomainTypes(String domainName,String domainType);

    /**
     * 删除根域名解析记录
     * @param customerDomains
     * @return
     * @throws Exception
     */
    String delDomainRecordList(String customerDomains) throws  Exception;

    /**
     * 删除子域名
     * @param customerDomains
     * @return
     * @throws Exception
     */
    String delCustomerConfig(String customerDomains) throws  Exception;

    /**
     * 查询当前页的省份集合
     * @param param
     * @param pagination
     * @return
     * @throws Exception
     */
    IDataset getOrderProList(Map param, Pagination pagination) throws Exception;

    /**
     * 查询指定订单的某一省份下的返回结果
     * @param param
     * @return
     * @throws Exception
     */
    List<Map<String, java.lang.Object>> getOrderDetailByPro(Map param) throws Exception;
    /**
     * 分页查询订单返回结果
     * @param param
     * @param pagination
     * @return
     * @throws Exception
     */
    IDataset getOrderDatilPage(Map param, Pagination pagination) throws Exception;

    /**
     * 校验订单下发的域名数量是否超过限制数量
     * @param param
     * @return
     */
    public boolean checkOrderNum(Map param);

    /**
     * 查询是否有未完成订单
     * @param param
     * @return
     */
    public boolean checkHasTradeOrder(Map param);

    /**
     * 添加域名解析订单记录
     * @param queryDnsJson
     * @return
     * @throws Exception
     */
    public String addDnsResultTask(String queryDnsJson,String attribution) throws Exception;

    /**
     * 下发DNS缓存清除任务订单
     * @param cleanCacheJson
     * @return
     * @throws Exception
     */
    public String addCleanDomainCacheTask(String  cleanCacheJson) throws  Exception;

    /**
     * 判断订单是否下发
     * @param custId
     * @param orderId
     * @param domainName
     * @param type
     * @return
     * @throws Exception
     */
    public String checkTaskIsList(String custId,String orderId,String domainName,String type) throws Exception;

    /**
     * 根据订单id查询订单结果详细
     * @param orderId 订单id
     * @return
     */
    public List<Map<String,Object>> queryOrderDetailList(String orderId) throws Exception;
    /**
     * 根据订单id查询订单
     * @param orderId 订单id
     * @return
     */
    public Map<String,Object> queryOrderById(String orderId) throws Exception;
    public List<Map<String,Object>> checkDeleteTypes(String domainName,String domainType,List<String> types);

}
